//
//  ZJStudyCourseNoteTableViewCellModel.m
//  LovingPartyBuilding
//
//  Created by ZJ on 2017/6/1.
//  Copyright © 2017年 刘应平. All rights reserved.
//

#import "ZJStudyCourseNoteTableViewCellModel.h"
#import "ZJSCNoteModel.h"
@implementation ZJStudyCourseNoteTableViewCellModel


- (CGFloat)cellHeight{
    if (!self.array) {
        return 0;
    }
    if ([self.array.firstObject isKindOfClass:[ZJSCNoteModel class]]) {//里面有数据
        CGFloat cellHeight = 0.0;
        if (self.array.count > 4) {//显示五条数据
            NSArray *newArray = [self.array subarrayWithRange:NSMakeRange(0, 5)];
            self.array = newArray;
        }
        for (ZJSCNoteModel *model in self.array) {
            cellHeight += model.cellHeight;
        }
        
        if (self.array.count > 4) {
            cellHeight += 44 * [UIScreen zj_screenHScale];
        }
        return cellHeight;
    }else{//无数据
      return 88 * [UIScreen zj_screenHScale];
    }
    
}

- (NSString *)description{
    return [self yy_modelDescription];
}

@end
